Skip to content

docs(freeticket-cli): settlements/api-keys + skill freeticket-mcp + el repo como plugin instalable - #13

Merged
lu-ochenty merged 7 commits into
mainfrom
docs/cli-0.9-settlements-apikeys
Aug 9, 2026
Merged

docs(freeticket-cli): settlements/api-keys + skill freeticket-mcp + el repo como plugin instalable#13
lu-ochenty merged 7 commits into
mainfrom
docs/cli-0.9-settlements-apikeys

Conversation

@LucasLeguizamo

@LucasLeguizamo LucasLeguizamo commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

La skill se quedó atrás del CLI. Faltaban comandos que ya existen (ft api-keys desde 0.8.0) y los que llegan con freeticket-cli#33.

  • ft settlements list y ft reports financials. Van con una nota explícita: la respuesta correcta a "cuánto se le liquida al organizador" es leer los números que FreeTicket ya calculó, no hacer aritmética sobre sales list. Es el error que un agente comete solo si nadie se lo dice.
  • ft api-keys create|list|revoke — credencial headless para CI/cron; el plano sale una sola vez.
  • ft admin tokens list|create|revoke — reemplaza pasear la cookie better-auth.session_token por los scripts.
  • ft events list --q.
  • Confirmación y exit codes: un abort sale 1 y sin TTY el comando falla de inmediato, así que ft … delete && next-step no ejecuta next-step. Documentado para que --yes se pase a propósito y no por costumbre.
  • El PDF de comprobante de liquidación no se baja por API (solo panel) — dicho para que nadie lo busque.

Versión mínima documentada: ft ≥ 0.9.0.


Además: skill freeticket-mcp y el repo como plugin instalable

Skill freeticket-mcp — setup local (stdio) y remoto (connector en claude.ai vía el AS OAuth 2.1 embebido), las tres capas de credenciales (anónimo B2C → workspace B2B → superadmin), los 87 tools y qué queda deliberadamente afuera. El README ya la listaba en esta branch; ahora existe.

El repo es un plugin. Ya tenía el layout que pide Agent Plugins 1.0.0 (skills/<name>/SKILL.md en la raíz), así que solo faltaban manifests — sin mover archivos y sin el repo freeticket-plugin aparte que preveía el roadmap:

Archivo Para qué
plugin.json + mcp.json Estándar Agent Plugins 1.0.0 — portable a cualquier cliente compatible. Validados contra los schemas oficiales.
.claude-plugin/plugin.json Claude Code, que todavía no lee el layout del estándar. Apunta a ./mcp.json con mcpServers en vez de duplicar la definición del server.
.claude-plugin/marketplace.json Canal de instalación de Claude Code, en este mismo repo: un repo de marketplace aparte para listar un solo plugin no se paga.

El plugin declara el server remoto mcp.appfreeticket.com/mcp, que autoriza por OAuth en el browser al primer uso. Primero se había puesto el stdio npx -y @freeticket/mcp y no funciona: el paquete nunca se publicó en npm — el plugin registraba el server y moría con "Connection closed". Queda anotado como hito 11 del roadmap, y el skill freeticket-mcp lo avisa hasta que se publique.

Instalación (probada de punta a punta contra esta branch, no solo validate):

/plugin marketplace add AppFreeticket/agent-skills
/plugin install freeticket@freeticket

→ las 3 skills en el cache y plugin:freeticket:freeticket en claude mcp list.

claude plugin validate pasa en los dos manifests. Contexto en AppFreeticket/ai-native → ROADMAP-AI-FIRST.md, hito 6.

🤖 Generated with Claude Code

LucasLeguizamo and others added 2 commits August 3, 2026 15:55
…n tokens

Cierra el drift entre la skill y el CLI 0.8.0/0.9.0. Lo que faltaba:

- ft settlements list y ft reports financials — la respuesta correcta a
  "cuánto se le liquida al organizador" es leer los números que FreeTicket ya
  calculó, no hacer aritmética sobre sales list. Queda dicho explícitamente
  porque es el error que un agente comete solo.
- ft api-keys create|list|revoke — credencial headless, el plano sale una vez.
- ft admin tokens — reemplaza pasear la cookie de sesión para CI.
- ft events list --q.
- Confirmación y exit codes: un abort sale 1 y sin TTY falla de una, así que
  `ft … delete && next-step` no ejecuta next-step.
- El PDF de comprobante de liquidación no se baja por API (solo panel).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… vieja

Cierra agent-skills#9 del lado de la skill: la copia instalada puede quedar
detrás del repo y el agente da instrucciones obsoletas sin saberlo. Ahora la
skill dice su revisión, la versión mínima de `ft`, y la regla cuando no
coinciden: le cree al CLI, no al archivo, reinstale con `npx skills add` y avise
para que el drift se arregle arriba y no se repita en silencio.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Update FreeTicket CLI docs for settlements, financial reports, and tokens

📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Document ft ≥ 0.9.0 commands: settlements, financial reports, API keys, and admin tokens.
• Clarify authoritative payout/financial workflow (reports financialssettlements list) and
 PDF limitations.
• Explain destructive-command confirmation behavior (TTY, exit codes) for safer scripting.
Diagram

graph TD
  U["User / CI script"] --> CLI["ft CLI"] --> V1[["B2B API v1"]] --> FIN["Financials & settlements"]
  U --> CLI --> KEYS["API keys (ft_live)"]
  U --> CLI --> ADM[["Admin API"]] --> TOK["Admin tokens (PAT)"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Generate command reference from OpenAPI/CLI help output
  • ➕ Reduces doc drift as new commands/flags ship
  • ➕ Enables versioned docs aligned to CLI releases
  • ➕ Lowers maintenance cost for large command surfaces
  • ➖ Requires building and maintaining a docs-generation pipeline
  • ➖ May miss nuanced guidance (e.g., payout interpretation, scripting caveats) unless supplemented
2. Add a “What’s new since X.Y” changelog section in docs
  • ➕ Makes upgrades/behavior changes discoverable (e.g., exit codes, tokens)
  • ➕ Smaller maintenance burden than full doc generation
  • ➖ Still requires manual updates and can drift over time
  • ➖ Doesn’t guarantee the main command tables stay complete

Recommendation: For immediate correctness, this PR’s manual updates are the right move because they add critical operational guidance (authoritative financial numbers, confirmation/TTY behavior) that auto-generated docs might omit. Longer-term, consider generating the command tables from the CLI/OpenAPI and keeping a small hand-written guidance layer to prevent future drift.

Files changed (2) +52 / -4

Documentation (2) +52 / -4
SKILL.mdBump minimum CLI version and document new financial/token workflows +19/-3

Bump minimum CLI version and document new financial/token workflows

• Updates the documented minimum 'ft' version to ≥ 0.9.0 and adds new commands ('reports financials', 'settlements list', 'api-keys', 'admin tokens'). Also clarifies destructive-command confirmation behavior (TTY + exit code 1 on abort) and explicitly directs money questions to 'reports financials'/'settlements' (including the panel-only proof PDF limitation).

skills/freeticket-cli/SKILL.md

commands.mdExpand CLI command reference with search, settlements/financials, and token/key sections +33/-1

Expand CLI command reference with search, settlements/financials, and token/key sections

• Adds '--q' support to 'ft events list' in the reads table and documents 'settlements list', 'reports financials', and 'api-keys list'. Introduces explanatory sections for settlements vs. financial reports, plus a dedicated service-credentials section for 'ft api-keys' and new admin token commands ('ft admin tokens list|create|revoke').

skills/freeticket-cli/references/commands.md

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Admin token docs inconsistent 🐞 Bug ≡ Correctness
Description
skills/freeticket-cli/references/commands.md still says a revocable admin service token is
“coming”, but this PR also adds the ft admin tokens list|create|revoke commands, which contradicts
the earlier guidance and can mislead CI/auth setup. The docs also don’t state (based on the actual
CLI interface) how to provide the newly minted plaintext token to later ft admin … commands.
Code

skills/freeticket-cli/references/commands.md[R159-161]

+| `ft admin tokens list` | — (no pagination) | SUPER_ADMIN |
+| `ft admin tokens create` | `--data` (`{"name","expiresAt?"}`) — plaintext shown once | SUPER_ADMIN |
+| `ft admin tokens revoke <id>` | `--yes` to skip confirm | SUPER_ADMIN |
Evidence
The Admin section in commands.md still claims a revocable service token is future work, but the
same file now lists ft admin tokens list/create/revoke. SKILL.md also recommends minting an
admin token for CI without documenting how that token is then provided to the CLI.

skills/freeticket-cli/references/commands.md[126-132]
skills/freeticket-cli/references/commands.md[159-165]
skills/freeticket-cli/SKILL.md[123-129]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The admin authentication section still frames service tokens as future work, but the same reference now documents `ft admin tokens …`. This creates contradictory guidance and also leaves out the critical “how to use the created token” step for headless `ft admin`.

### Issue Context
- The reference currently says tokens are “coming”, while listing the token commands.
- `SKILL.md` advises using `ft admin tokens create` for CI, but neither doc shows (per the real CLI contract/help) how the minted token is supplied to future admin commands.

### Fix Focus Areas
- skills/freeticket-cli/references/commands.md[126-138]
- skills/freeticket-cli/references/commands.md[159-165]
- skills/freeticket-cli/SKILL.md[123-129]
- skills/freeticket-cli/SKILL.md[137-138]

### What to change
1. Remove or rewrite the stale “MVP — a revocable service token replaces this …” wording so it matches the now-documented `ft admin tokens …` feature.
2. Add a short, **verified** snippet showing how the minted admin token is used for subsequent `ft admin` calls (confirm the exact env var / flag from the CLI’s actual behavior/help, then document that mechanism explicitly).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment on lines +159 to +161
| `ft admin tokens list` | — (no pagination) | SUPER_ADMIN |
| `ft admin tokens create` | `--data` (`{"name","expiresAt?"}`) — plaintext shown once | SUPER_ADMIN |
| `ft admin tokens revoke <id>` | `--yes` to skip confirm | SUPER_ADMIN |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

1. Admin token docs inconsistent 🐞 Bug ≡ Correctness

skills/freeticket-cli/references/commands.md still says a revocable admin service token is
“coming”, but this PR also adds the ft admin tokens list|create|revoke commands, which contradicts
the earlier guidance and can mislead CI/auth setup. The docs also don’t state (based on the actual
CLI interface) how to provide the newly minted plaintext token to later ft admin … commands.
Agent Prompt
### Issue description
The admin authentication section still frames service tokens as future work, but the same reference now documents `ft admin tokens …`. This creates contradictory guidance and also leaves out the critical “how to use the created token” step for headless `ft admin`.

### Issue Context
- The reference currently says tokens are “coming”, while listing the token commands.
- `SKILL.md` advises using `ft admin tokens create` for CI, but neither doc shows (per the real CLI contract/help) how the minted token is supplied to future admin commands.

### Fix Focus Areas
- skills/freeticket-cli/references/commands.md[126-138]
- skills/freeticket-cli/references/commands.md[159-165]
- skills/freeticket-cli/SKILL.md[123-129]
- skills/freeticket-cli/SKILL.md[137-138]

### What to change
1. Remove or rewrite the stale “MVP — a revocable service token replaces this …” wording so it matches the now-documented `ft admin tokens …` feature.
2. Add a short, **verified** snippet showing how the minted admin token is used for subsequent `ft admin` calls (confirm the exact env var / flag from the CLI’s actual behavior/help, then document that mechanism explicitly).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

LucasLeguizamo and others added 2 commits August 8, 2026 17:23
…oto, 3 capas de credenciales, 87 tools)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ce de Claude Code)

El repo ya tenía el layout que pide el estándar (skills/<name>/SKILL.md en la
raíz), así que se vuelve plugin con manifests, sin mover archivos ni crear un
repo aparte:

- plugin.json / mcp.json — Agent Plugins 1.0.0 (agent-plugins.org), portable a
  cualquier cliente compatible. El server MCP va por stdio con npx, pinneado a
  @freeticket/mcp@0.13.0 y autenticado con la config de `ft login`.
- .claude-plugin/plugin.json — Claude Code, que aún no lee el layout del
  estándar. Delega en el mcp.json de arriba vía `mcpServers` en vez de
  duplicar la definición del server.
- .claude-plugin/marketplace.json — el canal de instalación de Claude Code vive
  en este mismo repo; un repo de marketplace aparte solo para listar un plugin
  no se paga.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@LucasLeguizamo LucasLeguizamo changed the title docs(freeticket-cli): settlements, reports financials, api-keys, admin tokens docs(freeticket-cli): settlements/api-keys + skill freeticket-mcp + el repo como plugin instalable Aug 8, 2026
LucasLeguizamo and others added 3 commits August 8, 2026 17:26
@freeticket/mcp no está publicado en npm — el registro del plugin funcionaba
pero el server no arrancaba ("Connection closed"). El remoto ya está desplegado
y hace OAuth con el host, así que el plugin funciona sin publicar nada.

El manifest del estándar y el de Claude Code declaran el MISMO server con
nombres de transporte distintos ('streamable-http' vs 'http'): la duplicación
existe por esa divergencia de formatos, no por dos configuraciones.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…cp no está en npm

npx -y @freeticket/mcp falla con "Connection closed" porque el paquete nunca
se publicó. El skill lo daba por hecho.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@lu-ochenty
lu-ochenty merged commit b341ffc into main Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants